<?php
declare(strict_types=1);

namespace app\admin\controller;

use app\admin\service\interface\ConfigService;
use think\facade\Cache;
use think\facade\Session;
use think\facade\View;
use think\Request;

class Config{
    /**
     * Undocumented variable
     *
     * @var ConfigService
     */
    private $configService;
    public function __construct(ConfigService $configService)
    {
        $this->configService = $configService;
    }
    public function index(Request $request)
    {
        // $name = Cache::get("name");
        // View::assign("name", Session::get("name"));
        $GLOBALS["aa"] = "aaaaa";
        $res=[];
        $res['url'] = $request->url();
        $res['url.true'] = $request->url(true);
        $res['baseFile'] = $request->baseFile();
        $res['baseFile.true'] = $request->baseFile(true);
        $res['root'] = $request->root();
        $res['root.true'] = $request->root(true);
        $res['controller'] = $request->controller();
        $res['controller.true'] = $request->controller(true);
        $res['action'] = $request->action();
        $res['action.true'] = $request->action(true);
        $res['pathinfo'] = $request->pathinfo();
        // $res['module'] = $request->module();
    
        return View::fetch('', ['res'=>$res]);
    }
    public function add(Request $request)
    {
        var_dump([1,2,3]);
    }
    public function testAa()
    {
        Cache::clear();
        return "aaaa";
    }
    public function update(Request $request)
    {
        
    }

    public function delete(Request $request)
    {
        
    }

}